home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Programmation / Alpha ƒ / Help / HTML Help < prev    next >
Text File  |  1995-11-16  |  16KB  |  430 lines

  1. ================================================================================
  2. = What's Going On Here?
  3. ================================================================================
  4.  
  5. New! Command-double-clicking on a point attempts to open a URL in the 
  6. surrounding text and send it to your web browser. See here for more 
  7. details. 
  8.  
  9. HTML Mode is for editing HyperText Markup Language documents (suffix 
  10. ".html").  It is not a previewer, nor is it a verifier.  If you don't 
  11. know about HTML or the WorldWideWeb, FTP to ftp.netscape.com and pick 
  12. up their "Netscape" client to start with.  Run it and click on the 
  13. interesting buttons.
  14.  
  15. One of the fundamental concepts behind this HTML environment is to 
  16. avoid use of the mouse unless it's really advantageous.  Too many 
  17. environments slow down your work, and hurt your hands, by forcing you 
  18. to go back and forth between mouse and keyboard.
  19.  
  20. When you use this package, by default you will see bullet characters 
  21. (Ñ, option-8) being dribbled near where you insert elements.  These 
  22. are supposed to be a feature.  The tab key takes you to the next one.  
  23. For example, if you insert a header, the cursor will be inside the 
  24. header element, with a bullet after it.  Type in the header text and 
  25. hit tab to go to the bullet (and automatically delete the bullet).  If 
  26. you like, you may ignore the bullets and at any time either press 
  27. cmd-tab or select "Remove Marks" from the HTML menu to eliminate all 
  28. of them.  If you never want these at all, turn off the flag 
  29. htmlUseTabMarks (see the section on User-Settable Variables).
  30.     
  31. Without Pete Keleher's ongoing development of Alpha this wouldn't have 
  32. been possible in the first place.  I am also indebted to the authors 
  33. of the original html.el for GNU Emacs and latex.tcl for Alpha, from 
  34. whom I originally took ideas and some tcl code.
  35.     
  36. I want feedback.  I'm Scott Brim <swb@nr-atp.cit.cornell.edu>.  This 
  37. is "opinionware" -- if you use it regularly, you should tell me your 
  38. opinion.  If you want to hear about beta releases, send me mail and 
  39. I'll put you on the list.
  40.  
  41.  
  42.  
  43. ===============================================================================
  44. = The HTML Menu
  45. ===============================================================================
  46.  
  47. Headers    -        Insert section headers, from H1 to H6.
  48.  
  49. Text Blocks    -    These are various text-blocks.  Not all are here, 
  50.                 since some have enough importance to merit their own sections.
  51.                 However paragraph (<p>) is one to note under here.
  52.  
  53. Styles    -        Emphasis, etc.
  54.  
  55. Links    -        Hypertext links TO and FROM other points, plus images.
  56.  
  57. Lists    -        All kinds.
  58.  
  59. Forms    -        The elements for building forms.
  60.  
  61. Tables    -        The elements for building tables.
  62.  
  63. Character Entities    -    The entities for characters, for example ƒ is 
  64.                         ü.  The "short" list at the top can be added to
  65.                         with the "Add" item.  All possible entities are
  66.                         on the "all" menu.
  67.  
  68. Other Elements        -    Things which don't fit elsewhere.
  69.  
  70. Select Container    -    Selects matching tags which include the current 
  71.                         selection.  Repeated, it expands the selection.
  72.                         Like the "Balance" item under the Edit menu.
  73.  
  74. Untag                -    Removes a tag pair surrounding the current position
  75.                         or selection.
  76.  
  77. Remove Marks        -    Removes the Ñ's throughout the document.
  78.  
  79. New doc template    -    Produces <HTML>, <HEAD> and <BODY> elements.
  80.  
  81. URLs    -            Everything for managing the URL cache.
  82.  
  83.                     HTML mode accumulates a list of the URLs you use in 
  84.                     your HREFs, and saves the list across invocations of Alpha 
  85.                     (so it can help you to put in new URLs rapidly).  After 
  86.                     a while this list can get large.  When you select "Clean
  87.                     up" you will be presented with a list.  Use the 
  88.                     mouse to shift-click and select the URLs you want to keep.  
  89.                     The rest will be expunged.  If you select text, or copy
  90.                     text from another application into the Mac clipboard, you
  91.                     can insert this into the URL cache as a new URL.
  92.  
  93. Use Attributes    -    You don't have to be asked about all possible 
  94.                     attributes for every element.  You can select
  95.                     which ones you want to be asked about.  HTML Mode
  96.                     comes configured to ask about the most popular ones.
  97.                     
  98. HTML Helpers    -    You can launch various applications to view/check your
  99.                     HTML.  
  100.  
  101.  
  102.  
  103.  
  104. ================================================================================
  105. = Key Bindings
  106. ================================================================================
  107.  
  108. If you are using the default options, almost all key bindings are on 
  109. control-option, except for a few conflicts which I put on 
  110. shift-control-option and a few miscellaneous ones.
  111.     
  112. Here are the bindings, with comments, straight from html.tcl.
  113.  
  114.     #
  115.     # new file template and headers
  116.     #
  117.     ctl-opt-0        NewTemplate    # 0 before any headers
  118.     ctl-opt-1        Header1    
  119.     ctl-opt-2        Header2    
  120.     ctl-opt-3        Header3    
  121.     ctl-opt-4        Header4    
  122.     ctl-opt-5        Header5    
  123.     ctl-opt-6        Header6    
  124.  
  125.     #
  126.     # Blocks
  127.     #
  128.     ctl-opt-Return    Paragraph
  129.     Enter            Paragraph    # for powerbooks
  130.     ctrl-M            Paragraph
  131.     ctl-opt-;        Comment
  132.     ctl-opt-a        Address            
  133.     ctl-opt-q        Blockquote    # q for quote
  134.     ctl-opt-p        Preformatted    
  135.     # CENTER doesn't have a binding, since it will most likely go away
  136.     
  137.     #
  138.     # Styles
  139.     #
  140.     ctl-opt-e        Emphasized    
  141.     ctl-opt-s        Strong        
  142.     ctl-opt-b        Bold        
  143.     ctl-opt-c        Code        
  144.     ctl-opt-v        Varname        
  145.     shift-ctl-opt-c    Cite
  146.     ctl-opt-k        Keyboard    
  147.     ctl-opt-i        Italic        
  148.     ctl-opt-f        TT            
  149.     
  150.     #
  151.     # Links
  152.     #
  153.     ctl-opt-,        Anchor    # "<" is something pointed at
  154.     ctl-opt-.        Href    # ">" points to it
  155.     ctl-opt-/        Image    # "/" is right next to ">"
  156.     
  157.     #
  158.     # Lists
  159.     #
  160.     ctl-opt-u        Bulleted (UL)
  161.     ctl-opt-o        Numbered (OL)
  162.     ctl-opt-d        Directory
  163.     ctl-opt-m        Menu            
  164.     ctl-opt-n        ListEntry         # n is for 'eNtry'
  165.     ctl-opt-g        BuildDiscList    # g is for 'Glossary'
  166.     shift-ctl-opt-n    DiscEntry        # N, eNtry with shift key
  167.     
  168.     #
  169.     # Forms
  170.     #
  171.     shift-ctl-opt-f    Form
  172.     shift-ctl-opt-s    Select
  173.     shift-ctl-opt-o    Option
  174.     shift-ctl-opt-i    Input
  175.     shift-ctl-opt-t    Textarea
  176.  
  177.     #
  178.     # Character entities
  179.     #
  180.     # Only <, > and & are bound, to shift-cmd-opt-<char>
  181.     # The other entities can only be accessed from the menu.
  182.     shift-ctl-opt-,    LessThan
  183.     shift-ctl-opt-.    GreaterThan
  184.     shift-ctl-opt-7    Ampersand
  185.     
  186.     #
  187.     # Other
  188.     #
  189.     ctl-opt-!        linebreak    # shift-ctl-opt-1 for <BR>
  190.     ctrl-C L        commentline    # for internal aesthetics
  191.  
  192.     #
  193.     # Miscellaneous
  194.     #
  195.     cmd-B            select container
  196.     shift-ctl-opt-u    untag around the selection
  197.     cmd-shift-s        launch a browser
  198.     Tab                TabNext
  199.     Shift-Tab        TabPrevious
  200.     
  201.  
  202.  
  203.  
  204. ================================================================================
  205. = Other Possible Key Bindings
  206. ================================================================================
  207.  
  208. It is possible to change the keybindings in two ways.  First, by changing 
  209. the variables htmlPrefixString and htmlSPrefixString (see below, and 
  210. remember to change the Menu-related strings as well).  Second, by using 
  211. the Alpha 'bind' command.  
  212.  
  213. Here are some simple bindings, included as samples of what is possible.  
  214. For example, if you are using an international keyboard to produce German 
  215. HTML, you might put these lines in your prefs.html (under the Edit 
  216. menu).  For more complicated examples see the html.tcl source.
  217.  
  218.     bind 0x27 <s>         {insertText "Ä\;"} "HTML"
  219.     bind 0x27             {insertText "ä\;"} "HTML"
  220.     bind 0x29 <s>         {insertText "Ö\;"} "HTML"
  221.     bind 0x29             {insertText "ö\;"} "HTML"
  222.     bind 0x21 <s>         {insertText "Ü\;"} "HTML"
  223.     bind 0x21             {insertText "ü\;"} "HTML"
  224.     bind 0x1b             {insertText "ß\;"} "HTML"
  225.  
  226.  
  227.  
  228. ================================================================================
  229. = User-Settable Flags and Variables
  230. ================================================================================
  231.  
  232. HTML mode is highly customizable.  You can modify its behavior in one 
  233. of three ways.
  234.  
  235. If you don't know what any of the following means, ignore it for now.  
  236. You will eventually.
  237.     
  238. (1) Most HTML variables are simple things, for example the number of 
  239. entries you want in a new discursive list.  Almost all are set by 
  240. using the Flags menu (click on the little flag on the side of the 
  241. window the HTML file is in -- if you don't see the mode's flags and 
  242. variables, select "Mode Info" near the bottom of the menu and try 
  243. again).
  244.  
  245. FLAGS
  246. -----
  247.     
  248.     wordWrap        -    Newlines are automatically inserted as you type.  The 
  249.                         default is 1, lines will be wrapped.
  250.  
  251.     prefixString    -    The string to begin an HTML comment, and the one to 
  252.     suffixString    -    end a comment.  Generally a bad idea to change these.
  253.     
  254.     useStatusBar    -    If an element has attributes, and this is set, the 
  255.                         attributes will be asked about in the status bar.
  256.                         Otherwise they will be asked about in popup prompt 
  257.                         windows.  The default is 0, do not use the status bar.
  258.                         
  259.                         When using popups, an attribute can be skipped by
  260.                         clicking "cancel" or pressing cmd-..
  261.                         
  262.                         When using the status bar, at any point pressing cmd-v 
  263.                         will paste the contents of the clipboard.  Also, at 
  264.                         any point the tab key will match what you have typed 
  265.                         against your options, and complete what you have typed 
  266.                         as much as possible.  For example, when prompted with 
  267.                         "align=", you can type "m" and tab, and Alpha will fill 
  268.                         in "iddle".  When you are entering a URL, if you hit
  269.                         tab twice in a row, you will be presented with a menu
  270.                         of URLs you have used before.  To approve the selection 
  271.                         press return.  You can also back up over what has been 
  272.                         filled in and change it.  Try the tab key even when 
  273.                         nothing is showing.  Understanding how best to use it 
  274.                         takes some use.
  275.  
  276.     promptNoisily    -    If useStatusBar is set, Alpha will beep when 
  277.                         asking for element attribute information there.  The
  278.                         default is 1, do beep.
  279.  
  280.     useLowerCase    -    If 0, elements will be like <P>; if 1, like <p>.  
  281.                         The default is 0, upper case.
  282.     
  283.     useTabMarks        -    If 0, will not insert the Ñ characters.  The
  284.                         default is 1, to insert them.
  285.  
  286.     allContainers    -    If set, <P>, <LI>, and <DD> have 
  287.                         corresponding closing tags.  If not set the optional 
  288.                         closing tags are skipped.  The default is 1, make them 
  289.                         containers.
  290.                         
  291.     browseInForeground    -    if set, when you send a file to the browser, the
  292.                             browser will be brought to the foreground.  If you
  293.                             have lots of screen space and are just validating,
  294.                             uncheck this flag to leave the browser in the
  295.                             background and Alpha in the foreground.  The 
  296.                             default is 1, bring browser to foreground.
  297.                             
  298.                             Most browsers will *only* launch in the foreground
  299.                             when they are first brought up, regardless of your
  300.                             flag setting.  This is not an Alpha bug.
  301.                             
  302.                             
  303. VARIABLES
  304. ---------
  305.  
  306.     DLEntries        -    The default number of DD/DT entries for a new discursive 
  307.                         list.  The default is 3.
  308.                         
  309.     URLAttrs        -    Element attributes which are URLs and will involve
  310.                         the URL cache.  If you modify it, don't forget the
  311.                         "="s.  Most easily modified as in (3) below.
  312.                         
  313.     quotedAttrs        -    Element attributes which must usually be in 
  314.                         quotation marks.  If you modify it, don't forget
  315.                         the "="s.  Most easily modified as in (3) below.
  316.                         
  317.     htmlBindPrefix    -    The control keys for most keybindings.  Default is
  318.                         control-option.
  319.                         
  320.     htmlSBindPrefix    -    The control keys for most other keybindings.
  321.                         Default is shift-control-option.
  322.                         
  323.     htmlMenuPrefix    -    This is the string
  324.                         which controls the icons to show in the HTML menu
  325.                         for commands bound with htmlBindPrefix.  The
  326.                         default is "<B<I".
  327.     htmlSMenuPrefix    -    The same for htmlSBindPrefix.  The default is
  328.                         "<U<B<I".
  329.  
  330.  
  331. (2) One set of variables is more complex and is set another way.  This 
  332. is the list element attributes you usually usually want to be asked 
  333. about when creating new elements -- for example, whether you want to 
  334. be asked about COMPACT when creating a UL list.  These are set using 
  335. the "Use Attributes" menu item on the main HTML menu.  If you think 
  336. the defaults should be different in the distribution, tell me.
  337.  
  338. (3) Finally, to extend HTML mode into new territory, for example to add a 
  339. new element, you will need to do some TCL "set" commands in your 
  340. prefs.html (Edit -> Edit prefs.html).  You need to add to some list and 
  341. array variables.  Some are available through the flag menu to the right of 
  342. the edit window, but it's difficult to edit these there.  Do everything in 
  343. upper case!  When you're done, send your additions to me!
  344.  
  345.     HTMLmodeVars(quotedAttrs)    -    attributes which require quotation marks
  346.                                     around them.  A list.
  347.                                 
  348.     HTMLmodeVars(URLAttrs)        -    attributes which take URLs as values.  A
  349.                                     list.
  350.     
  351.     HTMLmodeVars(elemAttrsForAll)    -    All elements are allowed to 
  352.                                         have these attributes.  They will not 
  353.                                         be prompted for unless they are in 
  354.                                         HTMLElemAttrChoices for an element
  355.                                         being built.  A list.  
  356.  
  357.     HTMLwords                    -    keywords which should be highlighted when 
  358.                                     editing HTML in Alpha.  A list.
  359.     
  360.     htmlElemAttrAll                -    An array of all known HTML Elements.  Each
  361.                                     entry is a list of attributes for that
  362.                                     element.  For example htmlElemAttrAll(FORM)
  363.                                     is {ACTION= METHOD= ENCTYPE=}.  Be sure to
  364.                                     include the trailing = if an attribute 
  365.                                     takes values.
  366.                                     
  367.     htmlElemAttrChoices            -    An array.  Each entry is an element name,
  368.                                     and the content is all of the choices for
  369.                                     those attributes which have limited ones.
  370.                                     If a value can be anything, e.g.
  371.                                     NAME="frob", it won't be here.  However,
  372.                                     htmlElemAttrChoices(IMG) is {ALIGN=TOP
  373.                                     ALIGN=MIDDLE ALIGN=BOTTOM}.  Include
  374.                                     all attributes for which there are choices.
  375.                                     The entry for INPUT has all possibilities
  376.                                     for TYPE and ALIGN.
  377.                                     
  378.     htmlElemAttrUsed            -    This is the array of attributes you
  379.                                     want to be prompted for each time.  Usually
  380.                                     you don't change it explicitly.  Use the
  381.                                     menu selection "Use Attributes".
  382.  
  383.  
  384.  
  385. ===============================================================================
  386. = Custom Menu Entries
  387. ===============================================================================
  388.  
  389. There is a top-level entry in the HTML menu, "Custom", under which 
  390. you may add new elements -- or any other procedures -- by adding 
  391. some simple TCL code to your userStartup.tcl (under the Utils menu, 
  392. userStartup -> Edit).
  393.  
  394. First, define the list of elements to be listed in the menu.  Do this 
  395. by setting the variable htmlCustomMenuList.  For example:
  396.  
  397.     set htmlCustomMenuList {"Blink" "Style" "Frob"}
  398.  
  399. Then define the procedures to execute when these items are selected.  
  400. HTML Mode offers 4 utility procedures which you can use: 
  401. htmlBuildElem, htmlBuildCRElem, htmlBuildCR2Elem, and htmlOpenElem.  
  402. The first three create opening and closing tags, while htmlOpenElem 
  403. just creates a single tag.  htmlBuildElem surrounds the element with 
  404. no whitespace; htmlBuildCRElem puts it on its own line, and 
  405. htmlCR2Elem surrounds it with blank lines.  They all insert the 
  406. resulting element in the document EXCEPT htmlOpenElem, where you 
  407. must use insertText yourself.  
  408.  
  409. The procedure name HTML mode will look for will be "htmlElem" 
  410. followed by the exact name in your menu entry.
  411.  
  412. So here are some sample procedures:
  413.  
  414.     proc htmlElemBlink {} { htmlBuildElem BLINK }
  415.     proc htlmElemStyle {} { htmlBuildCRElem STYLE }
  416.     proc htmlElemFrob  {} { insertText [htmlOpenElem FROB] }
  417.     
  418. Of course you can make your procedures as complex as you like.
  419.  
  420. The customization will use any attribute lists you might build, so 
  421. for example you could have (as described under User-Settable Flags 
  422. and Variables):
  423.  
  424.     set htmlElemAttrAll(FROB) {ALIGN= SELECTOR POINTED}
  425.     set htmlElemAttrChoices   {ALIGN=BOTTOM ALIGN=MIDDLE ALIGN=TOP}
  426.     set htmlElemAttrUsed      {ALIGN= POINTED}
  427.     
  428.  
  429.  
  430.